<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="app">
    <h1>当前数据：{{counter}}</h1>
    <button @click="add">+</button>
    <button @click="sub">-</button>
</div>
<script>
    let app = new Vue({
        el:'#app',
        data:{
            counter:0
        },
        methods:{
            add(){this.counter++,console.log(0.2+0.1)},
            sub(){if (this.counter !=0) this.counter--}

        }
    })
</script>
</body>
</html>
